// Inifile zur Initzialisierung aller Interrupts
#include "init_interrupt.h"

//Timer0 als Overflow Interrupt initialisieren
void init_timer0()
{
	//          Normal-Modus          
	TCCR0A = 0x00;
	TCCR0B = 0x00;
	// Prescaler = 64
	TCCR0B |=(1<<CS02)|(0<<CS01)|(0<<CS00);
	// Timer vorladen
	//TCNT0 = timer0load;
	// Overflow Interrupt aktivieren
	TIMSK0 |= (1<<TOIE0);
}

//Timer1 initialisieren
void init_timer1()
{
	TCCR1A |= (1<<WGM10)|(1<<COM1A0)|(1<<COM1A1)|(1<<COM1B0)|(1<<COM1B1);
	TCCR1A &= ~(1<<COM1A0);
	TCCR1B |= (1<<CS10);//|(1<<CS12);
 	OCR1AL = 127;	// Helligkeit untere Zeile
 	OCR1BL = 127;   // Helligkeit obere Zeile
}

//Timer1 initialisieren
void init_timer2()
{
	//       Normal Moder
	TCCR2A = 0x00;
	// Prescaler = 1024
	TCCR2B |=(1<<CS22)|(1<<CS21)|(1<<CS20);
	TCCR2B &= ~(1<<WGM22);
	// Compare Interrupt aktivieren
	TIMSK2 |= (1<<TOIE2);
}








